var app = getApp()
import ajaxhelper from '../../utils/ajaxhelper.js';
Page({

  /**
   * 页面的初始数据
   */
  data: {
    
  },
  onLoad:function(options){
    var name = options.name;
    var price = options.price;
    var mediaType = options.mediaType;
    var sourceId = options.sourceId;
    var unitPrice = options.unitPrice;//单价
    var count = options.count;
    var chapterCount = options.chapterCount;//
    var coverMain = options.coverMain;
    var orderId = options.id;
    this.setData({
      name,
      price,
      mediaType,
      sourceId,
      chapterCount,
      unitPrice,
      count,
      coverMain,
      orderId
    })
  },
  // 包装并赠送
  goMarkGift(){
    var sourceId = this.data.sourceId;
    var coverMain = this.data.coverMain;
    var count = this.data.count;
    var orderId = this.data.orderId;
    var name = this.data.name;
    wx.navigateTo({
      url: '../markGiftCard/markGiftCard?sourceId=' + sourceId + '&coverMain=' + coverMain + '&count=' + count + '&orderId=' + orderId + '&name=' + name,
    })
  },
  // 去专辑详情
  goAlbumDetail(e) {
    var id = e.currentTarget.dataset.id;
    var type = e.currentTarget.dataset.type;
    if (type =='VIDEO'){
      wx.navigateTo({
        url: '../videoAlbumDetail/videoAlbumDetail?id=' + id,
      })
    } else if (type =='AUDIO'){
      wx.navigateTo({
        url: '../audioAlbumDetail/audioAlbumDetail?id=' + id,
      })
    }
    
  },
})